package com.ling.pl.security.model;

import com.ling.pl.core.commons.annotation.ModelProperty;
import com.ling.pl.core.commons.constant.TablePreDef;
import com.ling.pl.core.hibernate.identifier.Ling2UUIDGenerator;
import com.ling.pl.core.model.impl.BaseEntity;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import javax.persistence.*;

@Entity
@Table(name = DefaultUserLogin.TABLE)
@ModelProperty(comment = "登陆信息表")
public class DefaultUserLogin extends BaseEntity {

    public static final String TABLE = TablePreDef.BASEPRE + "User_Login";
    public static final String SEQ = TABLE;

    @Id
    @GenericGenerator(name = SEQ + "_GENERATOR", strategy = Ling2UUIDGenerator.STRATEGY_NAME, parameters = {@Parameter(name = "pkColumnValue", value = SEQ)})
    @GeneratedValue(strategy = GenerationType.TABLE, generator = SEQ + "_GENERATOR")
    @Column(name = "LOGIN_ID", length = 36)
    @ModelProperty(comment = "登陆编号")
    String id;

    @Column(name = "USER_ID", length = 36)
    @ModelProperty(comment = "用户编号")
    String userId;

    @Column(name = "USERNAME", length = 60)
    @ModelProperty(comment = "用户名")
    String username;

    @Column(name = "channel", length = 60)
    @ModelProperty(comment = "登录渠道")
    String channel;

    @Column(name = "PASSWORD", length = 70, nullable = false)
    @ModelProperty(comment = "密码")
    String password;

    @Column(name = "SALT", length = 10, nullable = false)
    @ModelProperty(comment = "密码,加密串")
    String salt;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }


}
